package com.jmyd.sharding.server;

import org.springframework.amqp.rabbit.annotation.EnableRabbit;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.scheduling.annotation.EnableAsync;
import tk.mybatis.spring.annotation.MapperScan;

/**
 * 分库分表服务启动类
 *
 * @author samphin
 * @since 2021-7-13 15:50:50
 */
@SpringBootApplication
@EnableAsync
@EnableCaching
@EnableAspectJAutoProxy(proxyTargetClass = true)
@EnableConfigurationProperties
@EnableRabbit
public class ShardingApplication {

    public static void main(String[] args) {
        SpringApplication.run(ShardingApplication.class, args);
    }

    @Configuration
    @MapperScan({"com.jmyd.sharding.server.mapper"})
    static class MapperConfig {
    }

    @Configuration
    @ComponentScan({
            "com.jmyd.commons.base",
            "com.jmyd.commons.exception",
            "com.jmyd.commons.redis.repository",
    })
    static class CommonsConfig {
    }
}
